<!--
* description: 交付专员下拉框
* author: xlc
* createdDate: 2020-12-16
-->
<template>
  <section>
    <el-col :span="span">
      <lableName
        :validrule="validrule"
        :cur-label-name="curLabelName"
        :is-show-label="isShowLabel"
        :is-require="isRequire"
      />
      <el-select
        v-model="modelCode"
        :multiple="isMul"
        collapse-tags
        :filterable="filterable"
        :placeholder="placeholder"
        :clearable="clearable"
        :disabled="disabled"
        size="small"
        @clear="clearCode"
        @change="sendCode"
      >
        <el-option
          v-for="item in optionDatas"
          :key="item[optionFields.length > 1 ? optionFields[0] : defOptionFields[0]]"
          :label="item[optionFields.length > 1 ? optionFields[1] : defOptionFields[1]]"
          :value="item[optionFields.length > 1 ? optionFields[0] : defOptionFields[0]]"
        >{{ item[optionFields.length > 1 ? optionFields[1] : defOptionFields[1]] }}</el-option>
      </el-select>
      <validateFormate
        :cur-label-name="curLabelName"
        :validrule="validrule"
      />
    </el-col>
  </section>
</template>
<script>
import { orgApis } from '@/api/vesalesapi'
import { dropdownMixins } from '@/components/mixins/dropdownMixins'
export default {
  name: 'DeliveryPeopleSelect',
  components: {
    lableName: () => import('@/components/lableName'), // 标题溢出样式组件
    validateFormate: () => import('@/components/validateFormate') // 校验提示样式组件
  },
  mixins: [dropdownMixins],
  props: {
    cityId: { type: String, default: '' },
    storeId: { type: String, default: '' }
  },
  data() {
    return {
      // 默认绑定数据对象字段
      defOptionFields: ['peopleId', 'peopleName'],
      placeholder: this.$t('sys.tips.esTip0'),
      curLabelName: this.labelName === '' ? '交付专员' : this.labelName,
      // API配置对象
      apiConfig: orgApis.deliveryPeoplequery,
      // 表格中台返回网格的字段
      apiQueryRow: [
      ],
      // 下拉查询条件
      listQuery: {
        isEnable: '1',
        cityId: this.cityId,
        storeId: this.storeId
      }
    }
  }
}
</script>
